capture log close#delimit ;set more off;clear;set mem 200m;set matsize 800;log using "JCRReplication3Sept2010.log", replace;*************************************************************;*     File-Name:  JCRReplication3Sept2010.do                *;*     Date:       Sept. 3, 2010                             *;*     Author:     CR Conrad                                 *;*************************************************************;*          JCR Divergent Incentives Replication             *;*************************************************************;use "JCRData3Sept2010.dta", clear;sort cowcode year;tsset cowcode year;*************************************************************;*                 Generating Variables                      *;*************************************************************;gen high_tort=.;replace high_tort=0 if tort==0;replace high_tort=0 if tort==1;replace high_tort=1 if tort==2;gen any_tort=.;replace any_tort=0 if tort==0;replace any_tort=1 if tort==1;replace any_tort=1 if tort==2;rename n_cats ncats;rename n_catr ncatr;gen lag_cat_rat=l.catr;gen partycim=party*cim;gen partycimlagrat=party*cim*lag_cat_rat;gen partylagrat=party*lag_cat_rat;gen cimlagrat=cim*lag_cat_rat;gen laghigh_tort=l.high_tort;gen lagcat_rat=l.catr;gen lagcatratparty=lagcat_rat*party;gen lagcatratcim=lagcat_rat*cim;gen lagcatratpartycim=lagcat_rat*party*cim;sort year;by year: egen ncatr_dict=sum(catr);by year: egen ncats_dict=sum(cats);*************************************************************;*                  Creating Time Counters                   *;*************************************************************;btscs catr year cowcode, generate (spellcount) f;gen spellcount2=spellcount*spellcount;gen spellcount3=spellcount2*spellcount;rename spellcount tr;rename spellcount2 tr2;rename spellcount3 tr3;drop _frstfl _prefail _tuntilf;btscs high_tort year cowcode, g(spellcount) f;gen spellcount2=spellcount*spellcount;gen spellcount3=spellcount2*spellcount;rename spellcount tt;rename spellcount2 tt2;rename spellcount3 tt3;*************************************************************;*               Bivariate Probit Reported                   *;*************************************************************;biprobit(catr=party cim partycim laghigh_tort communist muslim population level tradegdptr tr2 tr3)(high_tort=party cim partycim lagcat_ratcommunist g war population level tradegdp tt tt2 tt3), robust;*************************************************************;*             Individual Model of Commitment                *;*************************************************************;probit catr party cim partycim laghigh_tort communist muslim population level tradegdp tr tr2 tr3, robust;preserve;drawnorm CR_b1-CR_b13, n(10000) means(e(b)) cov(e(V)) clear;postutil clear;postfile mypost prob_hat0 lo0 hi0 prob_hat1 lo1 hi1 diff_hat diff_lo diff_hi             using sim , replace;            noisily display "start";            local a=0 ;while `a' <= 1 { ;    {;scalar h_party=0;scalar h_laghigh_tort=0.5;scalar h_muslim=0;scalar h_population=28.18216;scalar h_communist=0;scalar h_regscore=.6961359;scalar h_ncats=72.0935;scalar h_constant=1;scalar h_level=5.759579;scalar h_tradegdp=63.52898;scalar h_tr=4.040404;scalar h_tr2=30.07239;scalar h_tr3=263.7727;scalar h_constant=1;    generate x_betahat0 = CR_b1*(h_party)                            + CR_b2*(`a')                            + CR_b3*(h_party)*(`a')                            + CR_b4*h_laghigh_tort                            + CR_b5*h_communist                            + CR_b6*h_muslim                            + CR_b7*h_population                            + CR_b8*h_level                            + CR_b9*h_tradegdp                            + CR_b10*h_tr                            + CR_b11*h_tr2                            + CR_b12*h_tr3                            + CR_b13*h_constant;                                generate x_betahat1 = CR_b1*(h_party+1)                            + CR_b2*(`a')                            + CR_b3*(h_party+1)*(`a')                            + CR_b4*h_laghigh_tort                            + CR_b5*h_communist                            + CR_b6*h_muslim                            + CR_b7*h_population                            + CR_b8*h_level                            + CR_b9*h_tradegdp                            + CR_b10*h_tr                            + CR_b11*h_tr2                            + CR_b12*h_tr3                            + CR_b13*h_constant;                                    gen prob0=normal(x_betahat0);    gen prob1=normal(x_betahat1);    gen diff=prob1-prob0;        egen probhat0=mean(prob0);    egen probhat1=mean(prob1);    egen diffhat=mean(diff);        tempname prob_hat0 lo0 hi0 prob_hat1 lo1 hi1 diff_hat diff_lo diff_hi ;      _pctile prob0, p(5,95) ;    scalar `lo0' = r(r1);    scalar `hi0' = r(r2);          _pctile prob1, p(5,95);    scalar `lo1'= r(r1);    scalar `hi1'= r(r2);          _pctile diff, p(5,95);    scalar `diff_lo'= r(r1);    scalar `diff_hi'= r(r2);      scalar `prob_hat0'=probhat0;    scalar `prob_hat1'=probhat1;    scalar `diff_hat'=diffhat;        post mypost (`prob_hat0') (`lo0') (`hi0') (`prob_hat1') (`lo1') (`hi1')                 (`diff_hat') (`diff_lo') (`diff_hi') ;    };          drop x_betahat0 x_betahat1 prob0 prob1 diff probhat0 probhat1 diffhat ;        local a=`a'+ 0.1;        display "." _c;        } ;postclose mypost;use sim, clear;gen MV = ((_n-1)/10);append using JCRData3Sept2010;gen yline=0;graph twoway hist cim, percent color(gs14) yaxis(2)        ||   line diff_hat MV, clwidth(medium) clcolor(black) clpattern(solid)         ||   line diff_lo  MV, clpattern(dash) clwidth(thin) clcolor(black)        ||   line diff_hi  MV, clpattern(dash) clwidth(thin) clcolor(black)        ||   line yline  MV,  clwidth(medium) clcolor(black) clpattern(solid)         ||  ,               xlabel(, nogrid labsize(3))            ylabel(, nogrid labsize(3))            yscale(noline)            xscale(noline)            yline(0)            legend(off)            title("Effect of Power Sharing on Pr(CAT Commitment)", size(4))            subtitle(As Judicial Effectiveness Increases, size(4))            xtitle(Judicial Effectiveness, size(4)  )            ytitle("Effect of Power-Sharing", size(4))            xsca(titlegap(2))            ysca(titlegap(2))            scheme(s2mono) graphregion(fcolor(white));graph export Commitment.eps, replace;*************************************************************;clear;restore, not;use "JCRData3Sept2010.dta", clear;sort cowcode year;tsset cowcode year;*************************************************************;*                 Generating Variables                      *;*************************************************************;gen high_tort=.;replace high_tort=0 if tort==0;replace high_tort=0 if tort==1;replace high_tort=1 if tort==2;gen any_tort=.;replace any_tort=0 if tort==0;replace any_tort=1 if tort==1;replace any_tort=1 if tort==2;rename n_cats ncats;rename n_catr ncatr;gen lag_cat_rat=l.catr;gen partycim=party*cim;gen partycimlagrat=party*cim*lag_cat_rat;gen partylagrat=party*lag_cat_rat;gen cimlagrat=cim*lag_cat_rat;gen laghigh_tort=l.high_tort;gen lagcat_rat=l.catr;gen lagcatratparty=lagcat_rat*party;gen lagcatratcim=lagcat_rat*cim;gen lagcatratpartycim=lagcat_rat*party*cim;*************************************************************;*                  Creating Time Counters                   *;*************************************************************;btscs catr year cowcode, generate (spellcount) f;gen spellcount2=spellcount*spellcount;gen spellcount3=spellcount2*spellcount;rename spellcount tr;rename spellcount2 tr2;rename spellcount3 tr3;drop _frstfl _prefail _tuntilf;btscs high_tort year cowcode, g(spellcount) f;gen spellcount2=spellcount*spellcount;gen spellcount3=spellcount2*spellcount;rename spellcount tt;rename spellcount2 tt2;rename spellcount3 tt3;*************************************************************;*      Individual Model of Torture in CAT Countries         *;*************************************************************;probit high_tort party cim partycim lagcat_ratcommunist level population tradegdp g war tt tt2 tt3, robust;preserve;drawnorm CR_b1-CR_b14, n(10000) means(e(b)) cov(e(V)) clear;postutil clear;postfile mypost prob_hat0 lo0 hi0 prob_hat1 lo1 hi1 diff_hat diff_lo diff_hi             using sim , replace;            noisily display "start";            local a=0 ;while `a' <= 1 { ;    {;    scalar h_party=0;scalar h_lagcat_rat1=1;scalar h_lagcat_rat0=0;scalar h_communist=0;scalar h_level=3.787587;scalar h_population=25.2737;scalar h_tradegdp=68.34314;scalar h_g=2.853501;scalar h_war=0;scalar h_tt=1.456281;scalar h_tt2=7.598995;scalar h_tt3=54.58794;scalar h_constant=1;    generate x_betahat0 = CR_b1*(h_party)                            + CR_b2*(`a')                            + CR_b3*(h_party)*(`a')                              + CR_b4*h_lagcat_rat1                                                               + CR_b5*h_communist                            + CR_b6*h_level                            + CR_b7*h_population                            + CR_b8*h_tradegdp                            + CR_b9*h_g                            + CR_b10*h_war                            + CR_b11*h_tt                            + CR_b12*h_tt2                            + CR_b13*h_tt3                            + CR_b14*h_constant;                                generate x_betahat1 = CR_b1*(h_party+1)                            + CR_b2*(`a')                            + CR_b3*(h_party+1)*(`a')                              + CR_b4*h_lagcat_rat1                                                               + CR_b5*h_communist                            + CR_b6*h_level                            + CR_b7*h_population                            + CR_b8*h_tradegdp                            + CR_b9*h_g                            + CR_b10*h_war                            + CR_b11*h_tt                            + CR_b12*h_tt2                            + CR_b13*h_tt3                            + CR_b14*h_constant;                                                                                gen prob0=normal(x_betahat0);    gen prob1=normal(x_betahat1);    gen diff=prob1-prob0;        egen probhat0=mean(prob0);    egen probhat1=mean(prob1);    egen diffhat=mean(diff);        tempname prob_hat0 lo0 hi0 prob_hat1 lo1 hi1 diff_hat diff_lo diff_hi ;      _pctile prob0, p(5,95) ;    scalar `lo0' = r(r1);    scalar `hi0' = r(r2);          _pctile prob1, p(5,95);    scalar `lo1'= r(r1);    scalar `hi1'= r(r2);          _pctile diff, p(5,95);    scalar `diff_lo'= r(r1);    scalar `diff_hi'= r(r2);      scalar `prob_hat0'=probhat0;    scalar `prob_hat1'=probhat1;    scalar `diff_hat'=diffhat;        post mypost (`prob_hat0') (`lo0') (`hi0') (`prob_hat1') (`lo1') (`hi1')                 (`diff_hat') (`diff_lo') (`diff_hi') ;    };          drop x_betahat0 x_betahat1 prob0 prob1 diff probhat0 probhat1 diffhat ;        local a=`a'+ 0.1 ;        display "." _c;        } ;postclose mypost;use sim, clear;gen MV = ((_n-1)/10);append using JCRData3Sept2010;gen yline=0;graph twoway hist cim, percent color(gs14) yaxis(2)        ||   line diff_hat MV, clwidth(medium) clcolor(black) clpattern(solid)         ||   line diff_lo  MV, clpattern(dash) clwidth(thin) clcolor(black)        ||   line diff_hi  MV, clpattern(dash) clwidth(thin) clcolor(black)        ||   line yline  MV,  clwidth(thin) clcolor(black) clpattern(solid)         ||  ,               xlabel( , labsize(4))             ylabel(-.2 0 .2 .4 .6, labsize(4))            yscale(noline)            xscale(noline)            yline(0)            legend(off)            title("Dependent Variable: Pr(Systemic Torture)", size(4))            subtitle(" " "" " ", size(2))            xtitle(Judicial Effectiveness, size(4)  )            ytitle("Effect of Power-Sharing (CAT)", size(4))            xsca(titlegap(2))            ysca(titlegap(2))            scheme(s2mono) graphregion(fcolor(white));graph export Torture_CAT.eps, replace;*************************************************************;clear;restore, not;use "JCRData3Sept2010.dta", clear;sort cowcode year;tsset cowcode year;*************************************************************;*                 Generating Variables                      *;*************************************************************;gen high_tort=.;replace high_tort=0 if tort==0;replace high_tort=0 if tort==1;replace high_tort=1 if tort==2;gen any_tort=.;replace any_tort=0 if tort==0;replace any_tort=1 if tort==1;replace any_tort=1 if tort==2;rename n_cats ncats;rename n_catr ncatr;gen lag_cat_rat=l.catr;gen partycim=party*cim;gen partycimlagrat=party*cim*lag_cat_rat;gen partylagrat=party*lag_cat_rat;gen cimlagrat=cim*lag_cat_rat;gen laghigh_tort=l.high_tort;gen lagcat_rat=l.catr;gen lagcatratparty=lagcat_rat*party;gen lagcatratcim=lagcat_rat*cim;gen lagcatratpartycim=lagcat_rat*party*cim;*************************************************************;*                  Creating Time Counters                   *;*************************************************************;btscs catr year cowcode, generate (spellcount) f;gen spellcount2=spellcount*spellcount;gen spellcount3=spellcount2*spellcount;rename spellcount tr;rename spellcount2 tr2;rename spellcount3 tr3;drop _frstfl _prefail _tuntilf;btscs high_tort year cowcode, g(spellcount) f;gen spellcount2=spellcount*spellcount;gen spellcount3=spellcount2*spellcount;rename spellcount tt;rename spellcount2 tt2;rename spellcount3 tt3;*************************************************************;*            Effect of CAT Bivariate Probit                 *;*************************************************************;biprobit(catr=party cim partycim laghigh_tort communist muslim population level tradegdp tr tr2 tr3)(high_tort=party cim partycim lagcat_rat lagcatratparty lagcatratcim lagcatratpartycimcommunist g war population level tradegdp tt tt2 tt3), robust;*************************************************************;*      Effect of CAT in Countries with Party (Probit)       *;*************************************************************;probit high_tort lagcat_rat cim partylagcatratcim lagcatratparty partycim lagcatratpartycimcommunist g war population level tradegdp tt tt2 tt3, robust;preserve;drawnorm CR_b1-CR_b17, n(10000) means(e(b)) cov(e(V)) clear;postutil clear;postfile mypost prob_hat0 lo0 hi0 prob_hat1 lo1 hi1 diff_hat diff_lo diff_hi             using sim , replace;            noisily display "start";            local a=0 ;while `a' <= 1 { ;    {;    scalar h_party0=0;scalar h_party1=1;scalar h_lagcat_rat=0;scalar h_communist=0;scalar h_level=3.787587;scalar h_population=25.2737;scalar h_tradegdp=68.34314;scalar h_g=2.853501;scalar h_war=0;scalar h_tt=1.456281;scalar h_tt2=7.598995;scalar h_tt3=54.58794;scalar h_constant=1;    generate x_betahat0 = CR_b1*(h_lagcat_rat)                            + CR_b2*(`a')                            + CR_b3*h_party1                            + CR_b4*(h_lagcat_rat)*(`a')                            + CR_b5*(h_lagcat_rat)*(h_party1)                            + CR_b6*(h_party1)*(`a')                            + CR_b7*(h_lagcat_rat)*(h_party1)*(`a')                                                                  + CR_b8*h_communist                            + CR_b9*h_g                            + CR_b10*h_war                            + CR_b11*h_population                            + CR_b12*h_level                            + CR_b13*h_tradegdp                            + CR_b14*h_tt                            + CR_b15*h_tt2                            + CR_b16*h_tt3                            + CR_b17*h_constant;    generate x_betahat1 = CR_b1*(h_lagcat_rat+1)                            + CR_b2*(`a')                            + CR_b3*h_party1                            + CR_b4*(h_lagcat_rat+1)*(`a')                            + CR_b5*(h_lagcat_rat+1)*(h_party1)                            + CR_b6*(h_party1)*(`a')                            + CR_b7*(h_lagcat_rat+1)*(h_party1)*(`a')                                                                  + CR_b8*h_communist                            + CR_b9*h_g                            + CR_b10*h_war                            + CR_b11*h_population                            + CR_b12*h_level                            + CR_b13*h_tradegdp                            + CR_b14*h_tt                            + CR_b15*h_tt2                            + CR_b16*h_tt3                            + CR_b17*h_constant;                                                                             gen prob0=normal(x_betahat0);    gen prob1=normal(x_betahat1);    gen diff=prob1-prob0;        egen probhat0=mean(prob0);    egen probhat1=mean(prob1);    egen diffhat=mean(diff);        tempname prob_hat0 lo0 hi0 prob_hat1 lo1 hi1 diff_hat diff_lo diff_hi ;      _pctile prob0, p(5,95) ;    scalar `lo0' = r(r1);    scalar `hi0' = r(r2);          _pctile prob1, p(5,95);    scalar `lo1'= r(r1);    scalar `hi1'= r(r2);          _pctile diff, p(5,95);    scalar `diff_lo'= r(r1);    scalar `diff_hi'= r(r2);      scalar `prob_hat0'=probhat0;    scalar `prob_hat1'=probhat1;    scalar `diff_hat'=diffhat;        post mypost (`prob_hat0') (`lo0') (`hi0') (`prob_hat1') (`lo1') (`hi1')                 (`diff_hat') (`diff_lo') (`diff_hi') ;    };          drop x_betahat0 x_betahat1 prob0 prob1 diff probhat0 probhat1 diffhat ;        local a=`a'+ 0.1 ;        display "." _c;        } ;postclose mypost;use sim, clear;gen MV = ((_n-1)/10);append using JCRData3Sept2010; gen yline=0;graph twoway hist cim, percent color(gs14) yaxis(2)        ||   line diff_hat MV, clwidth(medium) clcolor(black)  clpattern(solid)         ||   line diff_lo  MV, clpattern(dash) clwidth(thin) clcolor(black)        ||   line diff_hi  MV, clpattern(dash) clwidth(thin) clcolor(black)        ||   line yline  MV,  clwidth(thin) clcolor(black) clpattern(solid)         ||  ,               xlabel( , labsize(4))             ylabel(, labsize(4))            yscale(noline)            xscale(noline)            yline(0)            legend(off)            title("Dependent Variable: Pr(Systemic Torture)", size(4))            subtitle(" " "" " ", size(2))            xtitle(Judicial Effectiveness, size(4)  )            ytitle("Effect of CAT (Power-Sharing)", size(4))            xsca(titlegap(2))            ysca(titlegap(2))            scheme(s2mono) graphregion(fcolor(white));            graph export CAT_Effect_Party.eps, replace;*************************************************************;clear;restore, not;use "JCRData3Sept2010.dta", clear;sort cowcode year;tsset cowcode year;*************************************************************;*                 Generating Variables                      *;*************************************************************;gen high_tort=.;replace high_tort=0 if tort==0;replace high_tort=0 if tort==1;replace high_tort=1 if tort==2;gen any_tort=.;replace any_tort=0 if tort==0;replace any_tort=1 if tort==1;replace any_tort=1 if tort==2;rename n_cats ncats;rename n_catr ncatr;gen lag_cat_rat=l.catr;gen partycim=party*cim;gen partycimlagrat=party*cim*lag_cat_rat;gen partylagrat=party*lag_cat_rat;gen cimlagrat=cim*lag_cat_rat;gen laghigh_tort=l.high_tort;gen lagcat_rat=l.catr;gen lagcatratparty=lagcat_rat*party;gen lagcatratcim=lagcat_rat*cim;gen lagcatratpartycim=lagcat_rat*party*cim;*************************************************************;*                  Creating Time Counters                   *;*************************************************************;btscs catr year cowcode, generate (spellcount) f;gen spellcount2=spellcount*spellcount;gen spellcount3=spellcount2*spellcount;rename spellcount tr;rename spellcount2 tr2;rename spellcount3 tr3;drop _frstfl _prefail _tuntilf;btscs high_tort year cowcode, g(spellcount) f;gen spellcount2=spellcount*spellcount;gen spellcount3=spellcount2*spellcount;rename spellcount tt;rename spellcount2 tt2;rename spellcount3 tt3;*************************************************************;*           Bivariate Probit with Keith & Tate              *;*************************************************************;gen partyKeithTate=party*KeithTate_JI;biprobit(catr=party KeithTate_JI partyKeithTate laghigh_tort communist muslim population level tradegdp tr tr2 tr3)(high_tort=party KeithTate_JI partyKeithTate lagcat_ratcommunist g war population level tradegdp tt tt2 tt3), robust;*************************************************************;*             Probit with Tate and Keith                    *;*************************************************************;probit catr party KeithTate_JI partyKeithTate laghigh_tort communist muslim population level tradegdp tr tr2 tr3, robust;*************************************************************;probit high_tort party KeithTate_JI partyKeithTate lagcat_ratcommunist g war population level tradegdp tt tt2 tt3, robust;*************************************************************;log close;